home *** CD-ROM | disk | FTP | other *** search
- property spriteNum, RowNum, ColNum, myColor, pImage
- global grid, CLRS
-
- on beginSprite me
- pImage = sprite(spriteNum)
- RowNum = GetGridRow()
- ColNum = GetGridCol()
- myColor = symbol(sprite(spriteNum).member.name)
- grid[RowNum][ColNum][1] = new(script("game pieces"), spriteNum)
- CLRS[symbol(grid[RowNum][ColNum][1].myColor)] = CLRS[symbol(grid[RowNum][ColNum][1].myColor)] + 1
- end
-
- on GetGridRow me
- if (pImage.locV >= 26) and (pImage.locV <= 60) then
- return 1
- else
- if (pImage.locV >= 60) and (pImage.locV <= 95) then
- return 2
- else
- if (pImage.locV >= 95) and (pImage.locV <= 130) then
- return 3
- else
- if (pImage.locV >= 130) and (pImage.locV <= 165) then
- return 4
- else
- if (pImage.locV >= 165) and (pImage.locV <= 200) then
- return 5
- else
- if (pImage.locV >= 200) and (pImage.locV <= 235) then
- return 6
- else
- if (pImage.locV >= 235) and (pImage.locV <= 270) then
- return 7
- else
- if (pImage.locV >= 270) and (pImage.locV <= 305) then
- return 8
- else
- if (pImage.locV >= 305) and (pImage.locV <= 340) then
- return 9
- else
- if (pImage.locV >= 340) and (pImage.locV <= 375) then
- return 10
- else
- if (pImage.locV >= 375) and (pImage.locV <= 410) then
- return 11
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end
-
- on GetGridCol me
- if (pImage.locH >= 27) and (pImage.locH <= 61) then
- return 1
- else
- if (pImage.locH >= 61) and (pImage.locH <= 96) then
- return 2
- else
- if (pImage.locH >= 96) and (pImage.locH <= 131) then
- return 3
- else
- if (pImage.locH >= 131) and (pImage.locH <= 166) then
- return 4
- else
- if (pImage.locH >= 166) and (pImage.locH <= 201) then
- return 5
- else
- if (pImage.locH >= 201) and (pImage.locH <= 236) then
- return 6
- else
- if (pImage.locH >= 236) and (pImage.locH <= 271) then
- return 7
- else
- if (pImage.locH >= 271) and (pImage.locH <= 306) then
- return 8
- else
- if (pImage.locH >= 306) and (pImage.locH <= 341) then
- return 9
- else
- if (pImage.locH >= 341) and (pImage.locH <= 376) then
- return 10
- else
- if (pImage.locH >= 376) and (pImage.locH <= 411) then
- return 11
- else
- if (pImage.locH >= 411) and (pImage.locH <= 436) then
- return 12
- else
- if (pImage.locH >= 436) and (pImage.locH <= 471) then
- return 13
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end
-